package 周赛._278;

import java.util.Arrays;

/**
 * @author 会玩的洋芋
 * https://leetcode-cn.com/problems/keep-multiplying-found-values-by-two/
 */
public class _5993_将找到的值乘以2 {
    /**
     * 排序
     * @param nums 目标传入数组
     * @param original 需要除 2 的值
     * @return int original -> 除 2 后的值
     */
    public int findFinalValue(int[] nums, int original) {
        Arrays.sort(nums);
        for (int num : nums) {
            if (num == original) {
                original = original << 1;
            }
        }
        return original;
    }
}
